<template>
  <div>
    <h1>🔍 Product Detail</h1>
    <p>Product ID: {{ productId }}</p>
    <button @click="$router.back()">← Back</button>
  </div>
</template>

<script setup lang="ts">
import { useRoute } from 'vue-router'

const route = useRoute()

// 类型安全：query.id 可能是 string | string[] | undefined
const productId = typeof route.query.id === 'string' ? route.query.id : 'N/A'
</script>
